package com.chuanke.ckfamily.service.common.impl;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chuanke.ckfamily.dao.common.TeamCreateLogDao;
import com.chuanke.ckfamily.dao.common.model.TeamCreateLog;
import com.chuanke.ckfamily.service.common.TeamCreateLogService;
import com.weijie.core.BaseBiz;

@Service
public class TeamCreateLogServiceImpl extends BaseBiz<TeamCreateLog, TeamCreateLogDao> implements TeamCreateLogService{


	@Transactional(rollbackFor=Exception.class,propagation=Propagation.REQUIRES_NEW)
	@Override
	public void save(String tid, String owner_user_no, int type) {
		try {
			TeamCreateLog log=new TeamCreateLog();
			log.setOwner_user_no(owner_user_no);
			log.setTid(tid);
			log.setType(type);
			log.setCreate_time(new Timestamp(System.currentTimeMillis()));
			log.setUpdate_time(new Timestamp(System.currentTimeMillis()));
			this.save(log);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	public List<TeamCreateLog> findTeamCreateLog() {
	
		return baseDao.findTeamCreateLog();
	}
}